/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.appspot.trafficando.domain;

import com.appspot.trafficando.domain.traffic.TrafficEventCategory;
import com.google.common.collect.Sets;
import java.util.List;
import java.util.Set;

/**
 *
 * @author domenico
 */
public enum EventType {

    /**
     * Informations on Movement of Vehicles on major roads
     */
    TRAFFIC(TrafficEventCategory.first()),
    /**
     * Informations on passenger transportation services
     * like nearest rail station, metro, bus stop etc.
     * and all related infos such distance (route map and arrival time by car o by feet),
     * available services (parking, tickets office, toilets, accessibility and other facilities),
     * live arrivals and departures, fares
     *
     */
    // TRANSPORTS,
    /**
     *  local weather informations
     */
    //WEATHER,
    /**
     * local news 
     */
    //NEWS,

    /**
     * Unknown
     */
    UNKNOWN(null);
    
    private EventCategory category;

    private EventType(EventCategory cat) {
        this.category = cat;
    }
    public static Set<EventType> ALL = Sets.newHashSet(TRAFFIC);

    public EventCategory categoryForTerm(String term) {
        return category.of(term);
    }
    
    public List<? extends EventCategory> categoriesWithScheme(String scheme) {
        return category.within(scheme);
    }

    public List<? extends EventCategory> categories() {
        return category.registeredCategories();
    }
}
